package com.yanmaohu.yulia.bean;

/**
 * @author Bright Lee
 */
public final class DatetimeTerm implements DatetimeValueExpression {

    private int beginIndex;
    private int endIndex;
    private DatetimePrimary datetimePrimary;
    private TimeZone timeZone;

    public DatetimeTerm(DatetimePrimary datetimePrimary, TimeZone timeZone) {
        this.beginIndex = datetimePrimary.getBeginIndex();
        this.endIndex = timeZone != null ? timeZone.getEndIndex() : datetimePrimary.getEndIndex();
        this.datetimePrimary = datetimePrimary;
        this.timeZone = timeZone;
    }

    @Override
    public int getBeginIndex() {
        return beginIndex;
    }

    @Override
    public int getEndIndex() {
        return endIndex;
    }

    public DatetimePrimary getDatetimePrimary() {
        return datetimePrimary;
    }

    public TimeZone getTimeZone() {
        return timeZone;
    }

}
